/*
 * Level.h
 *
 *  Created on: 06-Sep-2014
 *      Author: ali
 */

#ifndef LEVEL_H_
#define LEVEL_H_
#include "Coordinate.h"
#include "Node.h"
#include <iostream>
#include <vector>
using namespace std;

class Level
{
	int m_nLevel;
	double m_dLen;
	double m_dWidth;
	Coordinate m_cMyPos;
	int m_iCHID;
	std::vector<int> m_vectorSensor;
	Node m_cSink;

public:
	Level();
	void AddSink(Node& sink)
	{
		m_cSink = sink;
	}
	void AddSensor(Node &node);
	void SetLevel(int i);
	void SetLen(double l);
	void SetWidth(double d);
	void SetPos(Coordinate pos);
	double GetLen();
	int GetLevel();
	double GetWidth();
	Coordinate GetPos();
	bool IsCoordinateInside(Coordinate otherPos);
	Node GetCentralAciveSensor();

	bool SelectCH();
	int GetActiveNode();
	bool SendData(Node &);
	bool SendDirect(Node &);
	void SetCHID(int id)
	{
		m_iCHID = id;
	}
	Node* GetCH();

	int GetCHID();

	~Level();
	friend ostream & operator<<(ostream &out, Level& l);
};

#endif /* LEVEL_H_ */
